POV-Ray : Newsgroups : povray.binaries.images : Alpha Channel and Antialiasing : Re: Alpha Channel and Antialiasing Server Time
20 Aug 2024 06:19:30 EDT (-0400)
  Re: Alpha Channel and Antialiasing  
From: Alexander Enzmann
Date: 2 Oct 2000 10:44:46
Message: <39D89FB5.1E8AC150@mitre.org>
Ron Parker wrote:
> 
> On Fri, 29 Sep 2000 08:28:05 -0400, Alexander Enzmann wrote:
> >>
> >> (A) I render a white torus on a red background with AA on
> >>     and alpha channel on too.
> >
> >If you are going to do compositing, you should probably use a black
> >background.  That way there's no extraneous color contributions.
> 
> That's not true.  You'll get dark fringes as the black darkens whatever it's
> averaged with.

Exactly as it should be - if 50% of the pixel is black (background), and
50% is red, then you should have a final pixel that is a dark red.  If
you don't do that, your final image will always look aliased (jaggy).

Also, suppose you used, say, a mint green color as the background - how
would any program understand how to back it out (without knowing that
that mint green was used as a background) - the background color isn't
stored in the image file.  How would you know how much to back out of
each color channel?  And if you didn't store the background color in the
color channels, how would it ever appear as part of the final image?

Basically there are two ways typically used to store color +
alpha/opacity:
   - color * alpha, alpha
   - color, alpha

POV-Ray (as well as many other programs) uses the first method.  It
produces images that look correct in typical image viewers.

Xander


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.